<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/includes/config.inc.php');
include_once($_SERVER['DOCUMENT_ROOT']."/techcenter/config.php");
getConfig();
checkActiveLogin();
getUserInfo();

$sql = "INSERT INTO `tbNewYear` VALUES(:type, :x, :y, :user)";
db::Query($sql, array(':type'=>$_GET['type'], ':x'=>$_GET['x'], ':y'=>$_GET['y'], ':user'=>$USER['sUname']));
	
$sql = "SELECT * FROM `tbHolidayLog` WHERE `sUser` = :uname";
$q = db::Query($sql, array(':uname'=>$USER['sUname']));
$row_free = $q->fetch();
if($row_free['iCount'] != 0 and $row_free['iCount'] != ''){
	$sql = "UPDATE `tbHolidayLog` SET `iCount` = :count WHERE `sUser` = :uname";
	db::Query($sql, array(':count'=>($row_free['iCount'] - 1), ':uname'=>$USER['sUname']));
}
sendEmail('kpeterson5@edison.edu', 'User Picked For Firework', 'User Selected: '.$USER['sUname']);
?>